﻿@{ 
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
}
@using TimKiemViet_VN.Models
@using TimKiemViet_VN.DataService
@using Netcaso_MVC.WebUtilities
@using TimKiemViet_VN.Models;
@section featured {
    <section class="featured">
        <div class="content-wrapper">
            <hgroup class="title">
                <h1>@ViewBag.Title</h1>
            </hgroup>
        </div>
    </section>
}
@{
    int i = 0;
    List<NCS_HTMLControl> NCS_HTMLControls = (List<NCS_HTMLControl>)ViewBag.ListHTMLContent;
}
@using (Html.BeginForm())
{
    <table id="HTMLControlList" class="data_table float-left">
        <tr>
            <th style="width: 40px">
                #
            </th>
            <th class="width100">
                @MVCLocalization.getLocale("HTMLControlName")
            </th>
        </tr>
        @foreach (NCS_HTMLControl item in NCS_HTMLControls)
        {
            i++;
            <tr>
                <td>
                    @i
                </td>
                <td>
                    @Html.ActionLink(item.Name, "HTMLControlManagement", new { id = item.ModuleID })
                </td>
            </tr>
        }
    </table>
    <table id="HTMLControlDetail" class="option_table float-right">
        <tr>
            <td class="option_table_td_100">
                <span>@MVCLocalization.getLocale("HTMLControlName")</span>
            </td>
            <td>
                @{
        HTMLControlModel model = (HTMLControlModel)ViewBag.model;
        if (model != null)
        {
                    @Html.TextBox("txtName", model.HTMLControl.Name);
        }
        else
        {
                    @Html.TextBox("txtName", "");
        }
                   
                }
            </td>
        </tr>
        <tr>
            <td class="option_table_td_100">
                <span>@MVCLocalization.getLocale("HTMLControlContent")</span>
            </td>
            <td>
                @{
        model = (HTMLControlModel)ViewBag.model;
        if (model != null)
        {
                    @Html.TextArea("txtContent", model.HTMLControl.Content);
        }
        else
        {
                    @Html.TextArea("txtContent", "");
        }
                }
            </td>
        </tr>
        <tr>
            <td class="option_table_td_100">
            </td>
            <td>
                <input type="submit" name="btnSave" value="@MVCLocalization.getLocale("Save")" />
            </td>
        </tr>
    </table>
        if (ViewBag.hdID != null)
        {
            string hdID = ViewBag.hdID.ToString();
    @Html.Hidden("hdID", hdID);
        }
}